﻿using Base.EFCore.Base;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Base.EFCore.Entity
{
    public class Material : BaseEntity
    {
        public string Name { get; set; } = null!;

        public string Code { get; set; } = null!;

        public override void BeginSave(EntityEntry e)
        {
            base.BeginSave(e);
            if (e.State == Microsoft.EntityFrameworkCore.EntityState.Added)
            {
                Code = "0002";
                Name = "重新赋值";
            }
        }
    }
}
